package com.example.helloandroid;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;

public class Main extends Activity implements OnItemClickListener{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        GridView gridview = (GridView) findViewById(R.id.gridview);
        gridview.setAdapter(new ImageAdapter(this));
       
        gridview.setOnItemClickListener(this); 
    }
    public void onItemClick(AdapterView<?> parent, View v, int position, long id) {    	
    	if(position==0){
    		this.setContentView(new TxalapartaDrawView(this));
    	}else{
    		this.setContentView(new TxistuaDrawView(this));
    	}
    }
}